package com.study.guide.http;



import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.http.HttpServerCodec;

public class ServerInitializer extends ChannelInitializer<SocketChannel> {
	//初始化channel
	@Override
	protected void initChannel(SocketChannel ch) throws Exception {
		ChannelPipeline pl = ch.pipeline(); //连接所有处理器
		pl
		.addLast("httpServerCodec",new HttpServerCodec()) //http编解码

		.addLast("testHttpServerHandler",new HttpServerHandler());

	}

}
